package UI.BaseModels;

import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;


public class ReturnToMainMenuButton extends JButton {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 9147453749359129360L;
	/**
	 * All user panels have an object of this type as their back-button. Has a predefined action listener attached that calls the static method to switch to the user menu panel.
	 */
	public ReturnToMainMenuButton() {
	addActionListener(new SwitchToMainMenu());
	setFont(new Font("Tahoma", Font.PLAIN, 12));
	setBounds(5, 408, 110, 25);
	setText("< Main Menu");
	}
	
	private class SwitchToMainMenu implements ActionListener {
		public void actionPerformed(ActionEvent arg0) {
			UI.MainFrame.switchToPanel(UI.MainFrame.main_menu, null);
		}
	}
}
